<?
/**
* Copyright (c) 2002-2007 BioWare Corp.
* http://www.bigdaddymonitor.org
*
* This file is part of the BigDaddy Monitoring
* program. It is free software distributed under
* the terms of the BSD License. It is ditributed
* in the hopes that it will be useful, but
* WITHOUT ANY WARRANTY; without event the implied
* warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE.
*
* The BSD License is available from:
* http://www.opensource.org/licenses/bsd-license.php
**/
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<?
/*
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
// 
*/
//print_r($_POST);
?>
<html>
<head>

<title><?=$pageParams["title"];?></title>

<link rel="stylesheet" href="<?=CD_COMMON_2006;?>/css/style.css" type="text/css" />

<link rel="stylesheet" media="print" href="<?=CD_COMMON_2006;?>/css/print.css" type="text/css" />
<link rel="stylesheet" href="<?=THEME_DIR;?>/css/toolbar.css" type="text/css" />
<?
/*
<link rel="stylesheet" href="/_commonint/themes/staff/blue/style_staff.inc" type="text/css" />
*/
?>
<script type="text/javascript" src="<?=CD_COMMON_2006;?>/js/common.js"></script>

<link rel="stylesheet" type="text/css" href="/_common/js/yui/build/menu/assets/skins/sam/menu-dups.css">
<script type="text/javascript" src="/_common/js/yui/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="/_common/js/yui/build/container/container_core.js"></script>
<script type="text/javascript" src="/_common/js/yui/build/menu/menu.js"></script>

<script type="text/javascript">
    
    YAHOO.util.Event.onContentReady("bigdaddymenu", function() {
        
        function onMenuBarBeforeRender(p_sType, p_sArgs) {
            
            var oSubmenuData = {
                "monitoring": [
                    { text: "Server Control", url: "/index.html?page=ServerIndex"},
                    { text: "Server Group Control", url: "/index.html?page=ServerGroupIndex"},
                    { text: "Crontab Control", url: "/index.html?page=CrontabIndex"},
                ],
                "reports": [
                    { text: "Incident Reports", url: "/incident/index.html"},
                    { text: "Reporting Groups", url: "/index.html?page=ReportGroupIndex"},
                ],
                "admin": [
                    { text: "Monitoring Modules", url: "/index.html?page=MonModules"},
                    { text: "Ini Files", url: "/index.html?page=MonIniFiles"},
                    { text: "Phone/Email Tags", url: "/index.html?page=PhoneTags"},
                    { text: "Role Administration", url: "/admin/role/"},
                    { text: "User Admin", url: "/admin/user/"},
                ]
            };
            
            this.getItem(0).cfg.setProperty("submenu", {id: "monitoring", itemdata: oSubmenuData["monitoring"] });
            this.getItem(1).cfg.setProperty("submenu", {id: "reports", itemdata: oSubmenuData["reports"] });
            this.getItem(2).cfg.setProperty("submenu", {id: "admin", itemdata: oSubmenuData["admin"] });
        }
            
        var oMenuBar = new YAHOO.widget.MenuBar("bigdaddymenu", {autosubmenudisplay: true, showdelay: 250, hidedelay: 750, lazyload: true});
        
        oMenuBar.beforeRenderEvent.subscribe(onMenuBarBeforeRender);
        
        oMenuBar.render();
    });
    </script>
                                                                                                 
<?                                 

// Toolbar
    // IE and    Firefox use different positioning CSS values for the toolbar alignment
    
    if (substr_count($_SERVER["HTTP_USER_AGENT"],"MSIE")!=0)
    {
        ?>
        <link rel="stylesheet" href="<?=CD_COMMON_2006;?>/css/toolbar_ie.css" type="text/css" />
        <?
    }
    else
    {
        ?>
        <link rel="stylesheet" href="<?=CD_COMMON_2006;?>/css/toolbar_ff.css" type="text/css" />
        <?
    }
    


// Custom

if ($displayParams["applicationCSS"])
{
    $App->sApplicationCSS = $displayParams["applicationCSS"];
}

if ($App->sApplicationCSS)
{
    ?>
    <link rel="stylesheet" href="<?=$App->sApplicationCSS;?>" type="text/css" />
    <?
}
if ($App->sApplicationJS)
{
    ?>
    <script type="text/javascript" src="<?=$App->sApplicationJS;?>"></script>
    <?
}

if ($displayParams["sortableTables"])
{
	// include the JS to turn sortable tables sortable.
?>
	<script language="javascript" src="<?=CD_COMMON_2006;?>/js/sorttable.js"></script>
<?
}

?>
<?
if ($displayParams["jsTimeline"])
{
	// include the JS to turn sortable tables sortable.
?>
	<script type="text/javascript" src="/_common/js/simile/timeline-api.js"></script>
<?
}

?>

<script language="javascript">
// Set some dynamic variables

var theme_sHideIcon ="<?=THEME_DIR;?>/images/hide_app.gif";
var theme_sShowIcon ="<?=THEME_DIR;?>/images/show_app.gif";

var theme_sOptionsHideIcon ="<?=THEME_DIR;?>/images/app_options_hide_arrow.gif";
var theme_sOptionsShowIcon ="<?=THEME_DIR;?>/images/app_options_show_arrow.gif";

window.onbeforeunload = theme_OnUnload;

<?
if (count($App->aOptionHeaders)==0)
{
	?>
	var theme_BorderWidth=0;
	<?
}
else
{
	?>
	var theme_BorderWidth=3;
	<?
}
?>

</script>

<?
if ($displayParams["jsTimeline"])
{
    ?>
  <script language="javascript">
	var tl;
	function onLoad()
    {
        var eventSource = new Timeline.DefaultEventSource();
        var bandInfos = [
            Timeline.createBandInfo({
                eventSource:    eventSource,
                <?
                if ($displayParams["jsTimelineOptions"]["topCentreDate"] != "")
                {
                    ?>
                date:           "<?=$displayParams["jsTimelineOptions"]["topCentreDate"];?>",
                <?
                }
                ?>
                width:          "70%",
                <? if ($displayParams["jsTimelineOptions"]["topIntervalUnit"] == "") $displayParams["jsTimelineOptions"]["topIntervalUnit"] = "DAY";?>
                intervalUnit:   Timeline.DateTime.<?=$displayParams["jsTimelineOptions"]["topIntervalUnit"];?>, 
                intervalPixels: 100
            }),
            Timeline.createBandInfo({
                showEventText:  false,
                eventSource:    eventSource,
                <?
                if ($displayParams["jsTimelineOptions"]["bottomCentreDate"] != "")
                {
                    ?>
                date:           "<?=$displayParams["jsTimelineOptions"]["bottomCentreDate"];?>",
                <?
                }
                ?>
                trackHeight:    0.5,
                trackGap:       0.2,
                width:          "30%",
                <? if ($displayParams["jsTimelineOptions"]["bottomIntervalUnit"] == "") $displayParams["jsTimelineOptions"]["bottomIntervalUnit"] = "MONTH";?>
                intervalUnit:   Timeline.DateTime.<?=$displayParams["jsTimelineOptions"]["bottomIntervalUnit"];?>, 
                intervalPixels: 200
            })
        ];
        bandInfos[1].syncWith = 0;
        bandInfos[1].highlight = true;

        tl = Timeline.create(document.getElementById("my-timeline"), bandInfos);
        Timeline.loadXML("<?=$displayParams["jsTimelineData"];?>", function(xml, url) { eventSource.loadXML(xml, url); });
	}
    
	var resizeTimerID = null;
	
	function onResize()
    {
		if (resizeTimerID == null)
        {
			resizeTimerID = window.setTimeout(function()
            {
				resizeTimerID = null;
				tl.layout();
			}, 500);
		}
	}

	</script>  
    
    <?
}
?>


</head>

<body onload="theme_OnLoad();<? if ($displayParams["jsTimeline"]) echo "onLoad();";?>" scroll="no" onresize="theme_ResizeLayout();<? if ($displayParams["jsTimeline"]) echo "onResize();";?>">

<form method="post" action="/admin/query_quicklinks.php" name="quicklinks" style="margin: 0;">
	<input type="hidden" name="link" value="addcurrentpage">
	<input type="hidden" name="currentpagelinkurl" value="<?=$_SERVER["PHP_SELF"];?>?<?=$_SERVER["QUERY_STRING"];?>" />
	<input type="hidden" name="addcurrentpagelinkname" value="<?if ($pageParams["title"]=="") { echo "Current Page"; } else { echo $pageParams["title"]; }?>" />
	<input type="hidden" name="action" value="quicklinks" />
</form>
<?

// Top menu

if (!$App->bNoMenu) // check the $App object later for this check
{
    require(CP_THEME_COMMON_2006."/php/top_menu.inc");
}

// App title
// 
?>
<div style="width: 100%;">
<?

if (1==1)
{
    require(CP_THEME_COMMON_2006."/php/app_title.inc");
}

?>


<?

// Treeview


if (count($App->aOptionHeaders)>0)
{
    require(CP_THEME_COMMON_2006."/php/treeview.inc");
}


?>

<div id="theme_right_pane" style="

<?
if ($_COOKIE["theme_treeview"] == "hidden")
{
    echo "left: 0; width: 100%;";
}

if (count($App->aOptionHeaders)==0)
{
    echo "left: 0; width: 100%; border-left-width: 0;";
}


?>
"
>

<?

// Page Title

if (($Content->sTitle) || ($pageParams["title"]) )
{
    
    require(CP_THEME_COMMON_2006."/php/page_title.inc");
}


// Toolbar

if (is_array($Content->aOptions))
{
    require(CP_THEME_COMMON_2006."/php/toolbar.inc");
}




// Content

if (1==1)
{
    require(CP_THEME_COMMON_2006."/php/content.inc");
}


?>


